﻿namespace UtilityLibrary;

public static class StringLibrary
{
    /// <summary>
    /// 判断字符串开头是否为大写字母
    /// </summary>
    /// <param name="str">需要判断的字符串</param>
    /// <returns>布尔值，true - 表示字符串开头为大写字母；false - 表示字符串开头为小写字母</returns>
    public static bool StartsWithUpper(this string? str) 
    {
        if (string.IsNullOrEmpty(str)) 
        {
            return false;
        }

        char ch = str[0];
        return char.IsUpper(ch);
    }
}
